<template>
	<view class="container">
		<view style="padding: 10vh 0 10rpx;text-align: center;font-weight: 400;font-size: 40rpx;color: #fff;">
			Preference++
		</view>
		<view class="logo">
			<image src="/static/logo.png" mode="widthFix"></image>
		</view>
		<!-- <view class="img1">
			<image src="../../static/down_wenzi.png" mode="widthFix"></image>
		</view>
		<view class="img2">
			<image src="../../static/down_chahua.png" mode="widthFix"></image>
		</view> -->
		<view class="wenzi">
			<view class="flex flex-align flex-center ">优加加下载注册</view>
		</view>
		<view class="down_btn ">
			
			<view class="btn1 flex flex-align flex-center" @click="go_urls" style="border: 1px solid #fff;">
				<tui-icon name="ios" :size="26" color="#fff"></tui-icon> IOS版下载
			</view>
			<view class="btn1 flex flex-align flex-center" @click="go_url" style="background: #fff;color: #dc5538;">
				<tui-icon name="android" :size="26" color="#dc5538"></tui-icon> 安卓版下载
			</view>
		</view>
		<view class="zhezhao" v-if="isWeiXin">
			<image src="/static/xiazai_dao.png" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isWeiXin:false,
				url:'',
				i_url:''
			}
		},
		onLoad(e) {
			this.checkWeiXin()
			this.getData()
		},
		methods: {
			checkWeiXin() {
				let userAgent = navigator.userAgent;
				if (userAgent.includes("MicroMessenger")) {
					this.isWeiXin = true
				} else {
					this.isWeiXin = false
				}
			},
			go_url(){
				window.open(this.url)
			},
			go_urls(){
				this.tui.toast('暂未开放')
			},
			getData(){
				let that = this
				that.tui.request("api.data/download", "get", {}, false, false, true).then((res) => {
					console.log(res)
					that.url = res.data.app_download
					that.i_url = res.data.i_url
					
				}).catch((res) => {
					
				})
			}
		}
	}
</script>

<style lang="scss">
	page{background: url('../../static/down_bg.png') no-repeat;background-attachment: fixed;background-size: 100% 100%;}
	.logo{text-align: center;padding-top:8vh;margin-bottom: 30rpx;
		image{width:300rpx;border-radius: 20rpx;}
		
	}
	.wenzi{color: #fff;margin-top: 80rpx;
		view{font-size: 34rpx;line-height: 2; }
	}
	.img1{text-align: center;
		image{width: 500rpx;}
	}
	.img2{text-align: center;margin: 30rpx 0;
		image{width:650rpx;}
	}
	.down_btn{margin-top: 200rpx;width: 100%;box-sizing: border-box;padding: 0 60rpx;
		image{width: 40rpx;height: 40rpx;margin-right: 10rpx;}
		.btn1{margin: 30rpx auto;width: 350rpx;text-align: center;line-height: 80rpx;border-radius:10rpx;margin-top: 60rpx;border:1px solid #fff; color: #fff;}
	}
	.zhezhao{
		position: fixed;top: 0;left: 0;width: 100vw;height: 100vh;background: rgba(0, 0, 0, .3);z-index: 1111;text-align: center;
		image{width: 730rpx;}
	}
</style>